<template>
  <div>
      <div class="head">
          <router-link to="/index/mine">&lt;</router-link>
      <h1>我的订单</h1>
      <van-card v-for="(item,index) in orderList" :key="index"
  :num="item.num"
  :price="item.price"
  :title="item.goodsname"
  :thumb="$pre+item.img"
/>
      </div>
  </div>
</template>
<script>
import { mapGetters, mapActions} from 'vuex';
import {orderList} from "../../request/api"

export default {
  props: [],
  components: {},
  data() {
    return {
        userInfo:sessionStorage.getItem("token")?JSON.parse(sessionStorage.getItem("token")):{},
        orderList:[]
    };
},
  computed: {
    ...mapGetters({}),
},
  methods: {
    ...mapActions({}),
},
  mounted() {
      orderList({uid:this.userInfo.uid}).then(res=>{
        //   console.log(res);
          this.orderList = res.data.list.data[0].child.map(item=>{
              console.log(item);
              return item
          })
           
      })
  },
};
</script>
<style scoped>
.head a{
    font-size: 0.5rem;
}
.head h1{
    text-align: center;
}
</style>